/*
 * polygon.cpp
 *
 *  Created on: 08 May 2012
 *      Author: hframe
 */

#include "polygon.h"

usenamespace(androidplus::drawing)

startnamespace( androidplus )
startnamespace(ui)
startnamespace(widget)

polygon::polygon(point lefttop ,point righttop,point rightbottom , point leftbottom):
left_top(lefttop),right_top(righttop),left_bottom(leftbottom),right_bottom(rightbottom) {
 vertices=new t_float[12];//base class geometry will delete

 vertices[0]=left_top.x;
 vertices[1]=left_top.y;
 vertices[2]=left_top.z;

 vertices[3]=right_top.x;
 vertices[4]=right_top.y;
 vertices[5]=right_top.z;

 vertices[6]=right_bottom.x;
 vertices[7]=right_bottom.y;
 vertices[8]=right_bottom.z;

 vertices[9]=left_bottom.x;
 vertices[10]=left_bottom.y;
 vertices[11]=left_bottom.z;
 vertices_n=12;

 indices=new t_uint8[6];//base class geometry will delete
 indices[0]=0;
 indices[1]=1;
 indices[2]=2;

 indices[3]=0;
 indices[4]=2;
 indices[5]=3;

 indices_n=6;

}

polygon::~polygon() {

}

endnamespace(widget)
endnamespace(ui)
endnamespace(androidplus)
